﻿using UnityEngine;
using System.Collections;

public class ShipController2D : MonoBehaviour {
	public float force = 25.0f;
	public float rotateSpeed = 300.0f;

	// Update is called once per frame
	void Update () {
		Vector3 rotateRight = new Vector3 (0, 0, 10);

		if(Input.GetKey(KeyCode.W)){

			rigidbody.AddRelativeForce (Vector3.forward *force*Time.deltaTime);
		}
		if(Input.GetKey(KeyCode.S)){
			
			rigidbody.AddRelativeForce (Vector3.back *force*Time.deltaTime);
		}
		if(Input.GetKey(KeyCode.D)){
			
			transform.Rotate(Vector3.up*rotateSpeed*Time.deltaTime) ;
		}
		if(Input.GetKey(KeyCode.A)){
			
			transform.Rotate(Vector3.down*rotateSpeed*Time.deltaTime) ;
		}
	
	}
}
